<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="js/angular.min.js"></script>
</head>
<body>
   <!--
      https://suggest.taobao.com/sug?code=utf-8&q=电脑&callback=JSON_CALLBACK
   -->
 <div ng-app="myApp" ng-controller="myCon">
     <input type="text" ng-model="txt">
     <button ng-click="fn()">搜索</button>
     <ul>
         <li ng-repeat="x in datas">
             <span>{{x[0]}}</span>
         </li>
     </ul>
 </div>
<script type="text/javascript">
    angular.module("myApp",[]).controller("myCon",function ($scope,$http) {
        //点击事件
        $scope.fn=function () {
            console.log($scope.txt);
            var url="https://suggest.taobao.com/sug?code=utf-8&q="+$scope.txt+"&callback=JSON_CALLBACK";
            $http.jsonp(url).success(function (res) {
                  console.log(res.result);
                  $scope.datas=res.result;
            });
        }
    });




</script>
</body>
</html>